Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ID and class attribute support to tables #153

Open
wants to merge 1 commit into
base: lib
Choose a base branch
from

Conversation

kburton
Copy link

@kburton kburton commented Feb 28, 2014

Added support for {#id .class} attributes to tables when attributes are appended to the header line.

Added support for {#id .class} attributes to tables when attributes are appended to the header line.
@kburton
Copy link
Author

kburton commented Feb 28, 2014

I've implemented basic table attribute support, primarily so I could add the .table class (and others such as .table-striped) for Bootstrap 3 themed tables. This is used as follows:

Testing | Basic | Table {.table-class}
--------|-------|------
a       | b     | c

I could fairly easily implement a more powerful solution to allow the following if it would be useful:

Testing | Basic | Table {.th-row-class}
--------|-------|------ {.table-class}
a       | b     | c     {.td-row-class}
d       | e     | f     {.td-row-class-2}

or with the location of .table-class and .th-row-class switched.

@markseuffert
Copy link

+1 like. ID/class for the whole table would be nice, to format layout via CSS.

@michelf
Copy link
Owner

michelf commented Mar 6, 2014

I'd rather have the attribute braces go before or after the table, but I can't decide between the two. It seems to me that putting the attribute list just after a row would take too much horizontal space: tables often take much horizontal space and with line wrapping taking more than what you have is inconvenient.

I've also been looking forward adding an optional caption to the table. Right now, I'm leaning towards something that looks like this right now:

[ Table 1: Insightful Data ] {.caption-class}
Testing | Basic | Table
--------|-------|------
a       | b     | c
{.table-class}

@kburton
Copy link
Author

kburton commented Mar 12, 2014

I can see what you're saying, but I think that having attributes on separate lines before and after the table obscures the structure. I suppose that's going to be an inevitable consequence of trying to add attribute support to more HTML elements.

@jlj
Copy link

jlj commented Mar 15, 2014

Same need for me of adding a .table class at the table level for bootstrap.

I was inclined to add the class/id attributes after a tailing '|' of the header row, so as not to confuse it with internal annotation for the table cell, like

Testing | Basic | Table |{.table-class}
--------|-------|------
a       | b     | c

But the optional caption way would be fine as well. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants